<template>
	<view>
		<my-loading :vshow="loadingshow"></my-loading>
		<div class="body"></div>
		<!-- 导航 -->
		<div class="nav">
			<scroll-view :scroll-top="nav_typeleft[nav_typeid]" scroll-x="true" class="nav_scroll" :scroll-into-view="'nav_type'+nav_typeid">
				<div class="nav_type_list">
					<view v-for="(typevalue,type_index) in nav_type_data" :key="type_index" @tap="onvalscroll_type_fun(type_index)"
					 :id="'nav_type'+type_index" class="nav_list" :style="{color:type_index==nav_typeid?icons.color:'#444'}">{{typevalue.name}}</view>
					<div class="nav_scroll_type_dong" :style="{width:(nav_typewidth[nav_typeid]/3)+'px',left:(nav_typeleft[nav_typeid]+((nav_typewidth[nav_typeid]/3)))+'px',background:icons.color}"></div>
				</div>
			</scroll-view>
		</div>
		<!-- 搜索 -->
		<div  v-if="nav_typeid==0" class="sou_order">
		  <div class="sou_order_left">
			  <div class="sou_order_left_sou">{{icons.sousuo}}</div>
			  <div class="sou_order_center"><input class="sou_order_center_input" type="text" :placeholder="'商品名称'" @input="input_fun" v-model="sou_value"></div>
		  	  <div @click="sou_fun" class="sou_order_right">{{sou_state}}</div>
		  </div>
		  
		</div>
		<!-- 卡片滑动 -->
		<div  class="hua" :style="{height:nav_typeid!=0?((height-(navheight))+'px'):((height-(navheight*2))+'px')}">
			<swiper class="swiper" :style="{height:nav_typeid!=0?((height-(navheight))+'px'):((height-(navheight*2))+'px')}" :skip-hidden-item-layout="layout" :acceleration="acceleration" :current="nav_typeid" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" @change="swiperchange">
			                        <swiper-item>
										<scroll-view :style="{height:nav_typeid!=0?((height-(navheight))+'px'):((height-(navheight*2))+'px')}" :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" :lower-threshold="bottomnumber" @scrolltolower="scrolltolower">
			                            <div v-if="order_value_one=='' && order_value_one_start=='noMore'" class="kong_order">
			                                <div class="kong_order_bottom">目前没有相关订单</div>
			                              </div>
										<div  v-for="(order,index) in order_value_one" :key="order.no" class="order_box">
			                               <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no"  class="order_box_top">
			                                 <div class="order_box_top_shopname">
												 <div class="order_box_top_shopname_img"><image :src="order.logo" style="width: 100%;height: 100%;" mode="aspectFit"></image></div>
												 <div class="order_box_top_shopname_name uni-sl1">{{order.name}}</div>
												 <div class="order_box_top_shopname_icon">{{icons.dayuhao}}</div>
											 </div>
			                                 <div class="order_box_top_state" :style="{color:order.state_color}">{{order.state_name}}</div>
			                               </navigator>
			                            
			                               <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no" v-for="(order_char,index_char) in order.list" :key="index_char" class="order_box_content">
			                                 <div v-if="(order.list.length-1)==index_char" style="position: absolute;bottom: 0px;right:5%;width:100px;line-height:30px;height: 30px;font-size: 14px;color:red;text-align: right;">{{order.refund_state==1?(order.remark!='' && order.remark!=null && order.state!=9)?'退款失败':order.state!=9?'退款中':'':''}}</div>
			                                 <div  class="order_box_content_goods">
			                                   <div class="order_box_content_goods_img">
			                                     <image :src="cnds+'/upload/pro/'+order_char.img" style="width: 100%;height: 100%;" mode="aspectFit"></image>
			                                   </div> 
			                                   <div class="order_box_content_goods_info">
			                                     <div class="order_box_content_goods_info_left">
			                                       <div class="order_box_content_goods_info_title uni-sl2" >{{order_char.p_name}}</div>
			                                       <div class="order_box_content_goods_info_spec uni-sl1" >{{order_char.color}}/{{order_char.size}}</div>
			                                       <div class="order_box_content_goods_info_money uni-sl1" >￥{{order_char.p_price}} &nbsp;&nbsp;<span class="order_box_content_goods_info_money_span">&nbsp;x&nbsp;{{order_char.count}}</span></div>
			                                     </div>
			                                     
			                                   </div>
			                                 </div>
			                               </navigator> 
			                            
			                            
			                               <div class="order_box_bottom">
			                                 <div class="order_box_bottom_top">合计:¥{{order.money}}{{order.ems_fee!=0?'+运费:¥'+order.ems_fee:''}}&nbsp;{{order.score!=0?'积分:¥'+order.score:''}} &nbsp;{{order.cash!=0?'余额:¥'+order.cash:''}}&nbsp; {{order.youcouponmoney!=0?'优惠:¥'+order.youcouponmoney:''}}&nbsp; 实付：<span class="order_box_bottom_top_span">¥{{order.real_money}}</span></div>
			                            
			                                 <div class="order_box_bottom_bottom">
			                                   <div @click="pay(order.no,order.real_money)" class="order_box_bottom_bottom_pay" v-if="order.state==1">去付款</div>
			                                   <div @click="del_order(order.no)" class="order_box_bottom_bottom_del" v-if="order.state==11 || order.state==5  || order.state==6 || order.state==9">删除订单</div>
			                                   <div @click="qx_order(order.no)" class="order_box_bottom_bottom_other" v-if="order.state==1">取消订单</div>
			                                   <div  class="order_box_bottom_bottom_ems" v-if="order.state==3">查看物流</div>
			                                   <div @click="shou_order(order.no)" class="order_box_bottom_bottom_yes" v-if="order.state==3">确认收货</div>
			                                   <div @click="pin_order(order.no)" class="order_box_bottom_bottom_eva" v-if="order.state==4">去评价</div>
			                                   <div class="order_box_bottom_bottom_tix" v-if="order.state==2">提醒商家发货</div>
			                                 </div>
			                            
			                               </div>
			                             </div> 
										 <uni-load-more v-if="!(order_value_one=='' && order_value_one_start=='noMore')" :status="order_value_one_start"></uni-load-more>
										 </scroll-view>
			                        </swiper-item>
									<swiper-item v-if="type_index!=0" v-for="(typevalue,type_index) in nav_type_data" :key="type_index">
										<scroll-view :style="{height:nav_typeid!=0?((height-(navheight))+'px'):((height-(navheight*2))+'px')}" :scroll-top="scrollTop" scroll-y="true" class="scroll-Y"  :lower-threshold="bottomnumber" @scrolltolower="scrolltolower">
										
										<div v-if="typevalue.ordervalue=='' && order_value_start=='noMore'" class="kong_order">
										  <div class="kong_order_top">{{typevalue.icon}}</div>
										  <div class="kong_order_bottom">目前没有{{typevalue.name}}订单</div>
										</div> 
			                            <div v-if="nav_typeid!=5"  v-for="(order,index) in typevalue.ordervalue" v-bind:key="order.no" class="order_box">
			                                  <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no" class="order_box_top">
			                                    <div class="order_box_top_shopname">
													 <div class="order_box_top_shopname_img"><image :src="order.logo" style="width: 100%;height: 100%;" mode="aspectFit"></image></div>
													 <div class="order_box_top_shopname_name uni-sl1">{{order.name}}</div>
													 <div class="order_box_top_shopname_icon">{{icons.dayuhao}}</div>
												</div>
			                                    <div class="order_box_top_state" :style="{color:order.state_color}">{{order.state_name}}</div>
			                                  </navigator>
			                                
			                                  <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no" v-for="(order_char,index_char) in order.list" v-bind:key="index_char" class="order_box_content">
			                                     <div v-if="(order.list.length-1)==index_char" style="position: absolute;bottom: 0px;right:5%;width:100px;line-height:30px;height: 30px;font-size: 14px;color:red;text-align: right;">{{order.refund_state==1?(order.remark!='' && order.remark!=null && order.state!=9)?'退款失败':order.state!=9?'退款中':'':''}}</div>
			                                    <div  class="order_box_content_goods">
			                                      <div class="order_box_content_goods_img">
			                                        <image :src="cnds+'/upload/pro/'+order_char.img" style="width: 100%;height: 100%;" mode="aspectFit"></image>
			                                      </div> 
			                                      <div class="order_box_content_goods_info">
			                                        <div class="order_box_content_goods_info_left">
			                                          <div class="order_box_content_goods_info_title sl_2" >{{order_char.p_name}}</div>
			                                          <div class="order_box_content_goods_info_spec sl_1" >{{order_char.color}}/{{order_char.size}}</div>
			                                          <div class="order_box_content_goods_info_money sl_1" >￥{{order_char.p_price}} &nbsp;&nbsp;<span>x&nbsp;{{order_char.count}}</span></div>
			                                        </div>
			                                        
			                                      </div>
			                                    </div>
			                                  </navigator> 
			                                
			                                
			                                  <div class="order_box_bottom">
			                                    <div class="order_box_bottom_top">合计:¥{{order.money}}{{order.ems_fee!=0?'+运费:¥'+order.ems_fee:''}}&nbsp;{{order.score!=0?'积分:¥'+order.score:''}} &nbsp;{{order.cash!=0?'余额:¥'+order.cash:''}}&nbsp; {{order.youcouponmoney!=0?'优惠:¥'+order.youcouponmoney:''}}&nbsp; 实付：<span class="order_box_bottom_top_span">¥{{order.real_money}}</span></div>
			                                    			                            
			                                    <div class="order_box_bottom_bottom">
			                                      <div @click="pay(order.no,order.real_money)" class="order_box_bottom_bottom_pay" v-if="order.state==1">去付款</div>
			                                      <div @click="del_order(order.no)" class="order_box_bottom_bottom_del" v-if="order.state==11 || order.state==5 || order.state==6 || order.state==9">删除订单</div>
			                                      <div @click="qx_order(order.no)" class="order_box_bottom_bottom_other" v-if="order.state==1">取消订单</div>
			                                      <div class="order_box_bottom_bottom_ems" v-if="order.state==3">查看物流</div>
			                                      <div @click="shou_order(order.no)" class="order_box_bottom_bottom_yes" v-if="order.state==3">确认收货</div>
			                                      <div @click="pin_order(order.no)" class="order_box_bottom_bottom_eva" v-if="order.state==4">去评价</div>
			                                      <div class="order_box_bottom_bottom_tix" v-if="order.state==2">提醒商家发货</div>
			                                    </div>
			                                
			                                  </div>
			                                </div>  
											
											
											
											
											
			                                <div v-if="nav_typeid==5"  v-for="(order,indexindex) in typevalue.ordervalue" v-bind:key="order.no" class="order_box" style="border-radius: 0px;">
			                                    <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no" class="order_box_top">
			                                    <div class="order_box_top_shopname">
													 <div class="order_box_top_shopname_img"><image :src="order.logo" style="width: 100%;height: 100%;" mode="aspectFit"></image></div>
													 <div class="order_box_top_shopname_name uni-sl1">{{order.name}}</div>
													 <div class="order_box_top_shopname_icon">{{icons.dayuhao}}</div>
			                                    </div>
			                                  </navigator>
			                                
			                                  <navigator hover-class="none" :url="'../order_value/order_value?no='+order.no" v-for="(order_char,index_char) in order.list" v-bind:key="index_char" class="order_box_content">
			                                    <div  class="order_box_content_goods">
			                                      <div class="order_box_content_goods_img">
			                                        
			                                        <image :src="cnds+'/upload/pro/'+order_char.img" style="width: 100%;height: 100%;" mode="aspectFit"></image>
			                                        
			                                      </div>
			                                      <div class="order_box_content_goods_info">
			                                        <div class="order_box_content_goods_info_left">
			                                          <div class="order_box_content_goods_info_title sl_2" >{{order_char.p_name}}</div>
			                                          <div class="order_box_content_goods_info_spec sl_1" >{{order_char.color}}/{{order_char.size}}</div>
			                                          <div class="order_box_content_goods_info_money sl_1" >￥{{order_char.p_price}} &nbsp;&nbsp;<span>x&nbsp;{{order_char.count}}</span></div>
			                                        </div>
			                                        
			                                      </div>
			                                    </div>
			                                  </navigator> 
			                                
			                                
			                               <div class="order_box_bottom">
			                                    <div v-if="order.time>0 && !(order.remark!='' && order.remark!=null) && order.state!=9" class="order_box_bottom_top" style="text-align: left;float: left;width:80px;"><span v-html="icon['退款']" style="color:orange;font-size: 18px;font-family: iconfont;text-align: left;"></span>&nbsp;退款中
			                                    </div>
			                                    <div v-else-if="order.state!=9" class="order_box_bottom_top" style="text-align: left;float: left;width:80px;"><span v-html="icon['退款']" style="color:red;font-size: 18px;font-family: iconfont;text-align: left;"></span>&nbsp;退款失败
			                                    </div>
			                                    <div v-else class="order_box_bottom_top" style="text-align: left;float: left;width:80px;"><span v-html="icon['退款']" style="color:green;font-size: 18px;font-family: iconfont;text-align: left;"></span>&nbsp;退款成功
			                                    </div>
			                            
			                                    <div v-if="order.time>0 && !(order.remark!='' && order.remark!=null) && order.state!=9" class="order_box_bottom_top" style="text-align: left;float: left;width:80%">
			                                     <uni-count-down color="#FFFFFF" :background-color="icons.color" :border-color="icons.color" :day="order.day" :hour="order.hour" :minute="order.minute" :second="order.second"></uni-count-down>后会处理
			                                    </div>
			                                      <div v-else-if="order.state!=9 && order.remark!='' && order.remark!=null" class="order_box_bottom_top" style="text-align: left;float: left;width:60%;color:red;">卖家拒绝退款
			                                    
			                                    </div>
			                                    <div v-else-if="order.time<0 && !(order.remark!='' && order.remark!=null) && order.state!=9" class="order_box_bottom_top" style="text-align: left;float: left;width:60%;color:red;">卖家未处理
			                                    
			                                    </div>
			                                
			                                    <div class="order_box_bottom_bottom">
			                                      <div @click="refund_a('../refund_value/refund_value?no='+order.no)" class="order_box_bottom_bottom_tix" style="color: orange;border: 1px solid orange;border-radius: 0px;">查看详情</div>
			                                    </div>
			                                
			                                  </div>
			                                </div>
											<uni-load-more v-if="!(typevalue.ordervalue=='' && order_value_start=='noMore')" :status="order_value_start"></uni-load-more>
											</scroll-view>
			                        </swiper-item>
			</swiper>
		</div>
		<!-- 支付控件 -->
		<zf :start="start" :bot="bot" :zfdata="zfdata" @zfchange="cha_order" @closechange="closechange"></zf>
	</view>
</template>

<script>
	var _self;
	var user;
	var user_key;
	var yhpz;
	export default {
		data() {
			return {
				loadingshow:true,
				//支付参数
				start: false,
				bot: 700,
				zfdata:{
					name: '购物订单',
					money: 22.0 //parseFloat(_self.money).toFixed(2)
				},
				//支付参数
				icon:'',
				icons:'',
				layout:true,
				indicatorDots:false,
				autoplay:false,
				interval:0,
				duration:500,
				acceleration:true,
				nav_typeid: 0, //类型id
				ye:0,
				number:10,
				nav_typewidth: [], //导航条距离
				nav_typeleft: [], //导航条left
				state:'',
				nav_type_data:[{name:'全部',icon:''},{name:'待付款',icon:'',ordervalue:[]},{name:'待发货',icon:'',ordervalue:[]},{name:'待收货',icon:'',ordervalue:[]},{name:'待评价',icon:'',ordervalue:[]},{name:'退款',icon:'',ordervalue:[]}],
				sou_state:'搜索',
				sou_value:'',//搜索内容
				order_value:[],
				order_value_one:[],
				order:'',
				height:0,
				navheight:0,
				cnds:'',
				order_value_one_start:'',
				order_value_start:'',
				bottomnumber:0,//触底距离
				scrollTop:0,
				soustart:false,
			}
		},
		onReady(){
			_self=this;
			uni.createSelectorQuery() /* 获取查询节点 */
			.selectAll('.body') /* 获取class(.lazy) */
			.boundingClientRect(images => {
				/*  console.log(images);console.log(uni.getSystemInfoSync().windowHeight+"h"); */
				var arr = [];
				images.forEach((image, index) => {
					_self.height=parseInt(image.height);
				});
						
			})
			.exec();
			uni.createSelectorQuery() /* 获取查询节点 */
			.selectAll('.nav') /* 获取class(.lazy) */
			.boundingClientRect(images => {
				/*  console.log(images);console.log(uni.getSystemInfoSync().windowHeight+"h"); */
				var arr = [];
				images.forEach((image, index) => {
					_self.navheight=parseInt(image.height);
						
				});
						
			})
			.exec();
			uni.createSelectorQuery() /* 获取查询节点 */
			.selectAll('.nav_list') /* 获取class(.lazy) */
			.boundingClientRect(images => {
				/*  console.log(images);console.log(uni.getSystemInfoSync().windowHeight+"h"); */
				var arr = [];
				images.forEach((image, index) => {
					_self.nav_typewidth.push(image.width);
					_self.nav_typeleft.push(image.left);
					console.log(image.left);
					if((images.length-1)==index){
						_self.nav_typeid=_self.state;
							_self.order_value_fun(_self.nav_typeid);
							setTimeout(()=>{
								this.loadingshow=false;
							},1000);
					}	
				});
						
			})
			.exec();
			user=uni.getStorageSync('user');
			user_key=uni.getStorageSync('user_key');
			yhpz=uni.getStorageSync('yhpz');
			this.icon=uni.getStorageSync('icon');
			this.icons=uni.getStorageSync('icons');
			this.nav_type_data[1].icon=this.icons.daifukuan;
			this.nav_type_data[2].icon=this.icons.daifahuo;
			this.nav_type_data[3].icon=this.icons.daishouhuo;
			this.nav_type_data[4].icon=this.icons.daipingjia; 
			this.nav_type_data[5].icon=this.icons.tuikuan;
			this.cnds=uni.getStorageSync('CND_key');
			
		},
		onLoad(options) {
			this.state=options.state;
			
		},
		methods: {
			
				closechange: function(e) {
					this.start = e.start;
					this.bot = e.bot;
					
				},
				cha_order: function(no) {
					uni.request({
						url: uni.getStorageSync('APP_key') + '/payment/wxpayv3/payment_cha.php',
						method: 'POST',
						data: {
							no: no,
							user: user,
							user_key: user_key,
							yhpz: yhpz,
						},
						header: {
							'content-type': 'application/x-www-form-urlencoded'
						},
				
						success: r => {
							if (r.data.id == 1 ) {
								setTimeout(()=>{
									this.cha_order(no);
								}, 1000);
							} else if (r.data.id == 2) {
								this.start = false;
								this.bot = 700;
								uni.showToast({
									title: '支付成功!',
									duration: 1500
								});
								setTimeout(()=>{
									this.data_order();
								})
								
							}
						}
					});
				},
				pay:function(no,money){
					var arrs=[];
					arrs.push(no);
					this.start = true;
					this.bot = 0;
					this.zfdata.money=money;
					this.zfdata.noarr=arrs;
					this.zfdata.user=user;
					this.zfdata.user_key=user_key;
					this.zfdata.yhpz=yhpz;
				},
				pin_order:function(no){//商品评价
				uni.navigateTo({
					url:'../evaluate/evaluate?no='+no
				})
				} ,
				shou_order:function(no){//确认收货
					uni.showModal({
					    title: '订单提示',
					    content: '您确定要确认收货吗？',
					    success:  (res)=> {
					        if (res.confirm) {
								uni.request({
											 		url: uni.getStorageSync('APP_key') + '/order_date.php',
											 		method: 'POST',
											 		data: {
											 			user:user,
											 			user_key:user_key, 
											 			yhpz:yhpz,
											 			no:no,
											 			type:'shou',
								 		},
								 		header: {
								 			'content-type': 'application/x-www-form-urlencoded'
								 		},
								 		dataType: 'json',
								 	success:(res)=> {
										if(res.data.id==2){
											this.ye=0;
											this.order_value_fun(this.nav_typeid)
											uni.showToast({
											    title: '收货成功',
											    duration: 2000,
											});
										}else{
											uni.showToast({
											    title: '收货失败',
											    duration: 2000,
												icon:'none',
											});
										}
										
									
									
									                }
									                });
					        } else if (res.cancel) {
					            console.log('用户点击取消');
					        }
					    }
					});
				},
				del_order:function(no){//删除订单
				uni.showModal({
				    title: '订单提示',
				    content: '您确定要删除订单吗？',
				    success: (res)=> {
				        if (res.confirm) {
							uni.request({
										 		url: uni.getStorageSync('APP_key') + '/order_date.php',
										 		method: 'POST',
										 		data: {
										 			user:user,
										 			user_key:user_key, 
										 			yhpz:yhpz,
										 			no:no,
										 			type:'del',
							 		},
							 		header: {
							 			'content-type': 'application/x-www-form-urlencoded'
							 		},
							 		dataType: 'json',
							 	success:(res)=> {
									if(res.data.id==2){
										this.ye=0;
										this.order_value_fun(this.nav_typeid)
										uni.showToast({
										    title: '删除成功',
										    duration: 2000,
										});
									}else{
										uni.showToast({
										    title: '删除失败',
										    duration: 2000,
											icon:'none',
										});
									}
									
								
								
								                }
								                });
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
						
				 
					},
				qx_order:function(no){//取消订单
				uni.showModal({
				    title: '订单提示',
				    content: '您确定要取消该订单！',
				    success:  (res)=> {
				        if (res.confirm) {
							uni.request({
										 		url: uni.getStorageSync('APP_key') + '/order_date.php',
										 		method: 'POST',
										 		data: {
										 			user:user,
										 			user_key:user_key, 
										 			yhpz:yhpz,
										 			no:no,
										 			type:'qu',
							 		},
							 		header: {
							 			'content-type': 'application/x-www-form-urlencoded'
							 		},
							 		dataType: 'json',
							 	success:(res)=> {
									if(res.data.id==2){
										this.ye=0;
								        this.order_value_fun(this.nav_typeid);
										uni.showToast({
										    title: '取消成功',
										    duration: 2000,
										});
									}
									
								
								
								                }
								                });
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
				
				},
			refund_a:function(url){
				uni.navigateTo({
					url:url
				})
			},
			sou_fun:function(){
				if(this.sou_value==''){
					uni.showToast({
					    title: '请输入商品名称搜索',
					    duration: 2000,
						icon:'none',
					});
					return;
				}
				if(this.sou_state=='搜索'){
					this.soustart=true;
					this.sou_state='取消';
					this.ye=0;
					this.order_value_fun(this.nav_typeid);
				}else{
					this.sou_state='搜索';
					this.sou_value='';
					this.soustart=false;
					this.order_value_fun(this.nav_typeid);
				}
				
			},
			input_fun:function(e){
				this.sou_state='搜索';
				if(this.sou_value==''){
					this.soustart=false;
					this.order_value_fun(this.nav_typeid);
				}
			},
			scrolltolower:function(){
			     /* this.order_value_one_start='loading';
			     this.order_value_start='loading'; */
				 var eid=this.nav_typeid;
			     if(eid==0 && this.order_value_one_start=='more' && this.ye>0){
					 if(this.soustart==true){//搜索
						 this.order_value_one_start='loading'
						     setTimeout(function(){
						 uni.request({
						 			 		url: uni.getStorageSync('APP_key') + '/order_data.php',
						 			 		method: 'POST',
						 			 		data: {
						 			 			user:user,
						 			 			user_key:user_key, 
						 			 			yhpz:yhpz,
						 			 			ye:this.ye,
						 			 			number:this.number, 
						 			 			data_type:'sou',
						 			 			type:this.nav_typeid,
												sou_value:this.sou_value,
						  			
						  		},
						  		header: {
						  			'content-type': 'application/x-www-form-urlencoded'
						  		},
						  		dataType: 'json',
						  	success:(res)=> {
						 		this.ye+=1;
						 		
						 		var datanumber=0;
						 		res.data.forEach((item,index)=>{
						 		       // 判断第一次遍历为空
						 		       let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'}; 
						 		       let id=0;
						 		       for(let i=0;i<this.order_value_one.length;i++){
						 		          if(this.order_value_one[i].no==item.no){
						 		             id=1;
						 		          }
						 		       }
						 		       if(id!=1){
						 				   datanumber=datanumber+1;
						 		       this.order_value_one.push(obj);
						 		          res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
						 		           
						 		          if(item.no==item1.no){
						 		            this.order_value_one[this.order_value_one.length-1].list.push(item1);
						 		            this.order_value_one[this.order_value_one.length-1].money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
						 		            this.order_value_one[this.order_value_one.length-1].youcouponmoney=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
						 		            this.order_value_one[this.order_value_one.length-1].score=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].score*100)+(parseInt(item1.score*100)))/100);
						 		            this.order_value_one[this.order_value_one.length-1].cash=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].cash*100)+(parseInt(item1.cash*100)))/100);
						 		            this.order_value_one[this.order_value_one.length-1].ems_fee=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
						 					
											this.order_value_one[this.order_value_one.length-1].real_money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
						 		          
						 		       }
						 		           })
						 		       }
						 		    
						 		});
						 		if(res.data.length==0 || datanumber<this.number){
						 			this.order_value_one_start='noMore'
						 		}else{
						 			this.order_value_one_start='more'
						 		}
						 	  },
						 	  });
						 	  }.bind(this),500);
					 }else{//不是搜索
					 this.order_value_one_start='loading'
					    setTimeout(function(){
			     	uni.request({
			     				 		url: uni.getStorageSync('APP_key') + '/order_data.php',
			     				 		method: 'POST',
			     				 		data: {
			     				 			user:user,
			     				 			user_key:user_key, 
			     				 			yhpz:yhpz,
			     				 			ye:this.ye,
			     				 			number:this.number, 
			     				 			data_type:'all',
			     				 			type:this.nav_typeid,
			     	 			
			     	 		},
			     	 		header: {
			     	 			'content-type': 'application/x-www-form-urlencoded'
			     	 		},
			     	 		dataType: 'json',
			     	 	success:(res)=> {
							this.ye+=1;
			     			
							var datanumber=0;
			     			res.data.forEach((item,index)=>{
			     			       // 判断第一次遍历为空
			     			       let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'}; 
			     			       let id=0;
			     			       for(let i=0;i<this.order_value_one.length;i++){
			     			          if(this.order_value_one[i].no==item.no){
			     			             id=1;
			     			          }
			     			       }
			     			       if(id!=1){
									   datanumber=datanumber+1;
			     			       this.order_value_one.push(obj);
			     			          res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
			     			           
			     			          if(item.no==item1.no){
			     			            this.order_value_one[this.order_value_one.length-1].list.push(item1);
			     			            this.order_value_one[this.order_value_one.length-1].money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
			     			            this.order_value_one[this.order_value_one.length-1].youcouponmoney=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
			     			            this.order_value_one[this.order_value_one.length-1].score=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].score*100)+(parseInt(item1.score*100)))/100);
			     			            this.order_value_one[this.order_value_one.length-1].cash=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].cash*100)+(parseInt(item1.cash*100)))/100);
			     			            this.order_value_one[this.order_value_one.length-1].ems_fee=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
			     			            
			     						this.order_value_one[this.order_value_one.length-1].real_money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
			     			          
			     			       }
			     			           })
			     			       }
			     			    
			     			});
							if(res.data.length==0 || datanumber<this.number){
								this.order_value_one_start='noMore'
							}else{
								this.order_value_one_start='more'
							}
			     		  },
			     		  });
						  }.bind(this),500);
						  }
			     }else if(eid==5 && this.order_value_start=='more' && this.ye>0){
					  this.order_value_start='loading';
					 setTimeout(function(){
						 uni.request({
						 			 		url: uni.getStorageSync('APP_key') + '/order_data.php',
						 			 		method: 'POST',
						 			 		data: {
						 			 			user:user,
						 			 			user_key:user_key, 
						 			 			yhpz:yhpz,
						 						ye:this.ye,
						 						number:this.number,
						 						data_type:'no',
						 						type:8,
						  			
						  		},
						  		header: {
						  			'content-type': 'application/x-www-form-urlencoded'
						  		},
						  		dataType: 'json',
						  	success:(res)=> {
								this.ye+=1;
						                 this.order= res.data; 
						 				var datanumber=0;
						          res.data.forEach((item,index)=>{
						              // 判断第一次遍历为空
						              let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'};
						               let id=0;
						              for(let i=0;i<this.nav_type_data[eid].ordervalue.length;i++){
						                 if(this.nav_type_data[eid].ordervalue[i].no==item.no){
						                    id=1;
						                 }
						              }
						              if(id!=1){
						 				  datanumber=datanumber+1;
						               this.nav_type_data[eid].ordervalue.push(obj);
						                 res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
						                  
						                 if(item.no==item1.no){
						                   let leng=(this.nav_type_data[eid].ordervalue.length)-1;
						 				  this.nav_type_data[eid].ordervalue[leng].list.push(item1);
						                   this.nav_type_data[eid].ordervalue[leng].money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
						                   this.nav_type_data[eid].ordervalue[leng].youcouponmoney=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
						                   this.nav_type_data[eid].ordervalue[leng].score=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].score*100)+(parseInt(item1.score*100)))/100);
						                   this.nav_type_data[eid].ordervalue[leng].cash=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].cash*100)+(parseInt(item1.cash*100)))/100);
						                   this.nav_type_data[eid].ordervalue[leng].ems_fee=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
						                   
										   
						                   this.nav_type_data[eid].ordervalue[leng].real_money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
						                   		
						              }
						                  })
						              }
						           
						 
						               
						              
						         
						       }); 
						 	  if(res.data.length==0 || datanumber<this.number){
						 	  	this.order_value_start='noMore'
						 	  }else{
						 	  	this.order_value_start='more'
						 	  }
						                 }
						                 });
			     	}.bind(this),500);
			     }else if(eid!=5 && eid!=0 && this.order_value_start=='more' && this.ye>0){
					 this.order_value_start='loading';
					    setTimeout(function(){
			     	uni.request({
			     				 		url: uni.getStorageSync('APP_key') + '/order_data.php',
			     				 		method: 'POST',
			     				 		data: {
			     				 			user:user,
			     				 			user_key:user_key, 
			     				 			yhpz:yhpz,
			     							ye:this.ye,
			     							number:this.number,
			     							data_type:'no',
			     							type:this.nav_typeid,
			     	 			
			     	 		},
			     	 		header: {
			     	 			'content-type': 'application/x-www-form-urlencoded'
			     	 		},
			     	 		dataType: 'json',
			     	 	success:(res)=> {
							this.ye+=1;
			     	                this.order= res.data; 
									var datanumber=0;
			     	         res.data.forEach((item,index)=>{
			     	             // 判断第一次遍历为空
			     	             let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'};
			     	             let id=0;
			     	             for(let i=0;i<this.nav_type_data[eid].ordervalue.length;i++){
			     	                if(this.nav_type_data[eid].ordervalue[i].no==item.no){
			     	                   id=1;
			     	                }
			     	             }
			     	             if(id!=1){
									 datanumber=datanumber+1;
			     	             this.nav_type_data[eid].ordervalue.push(obj);
			     	                res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
			     	                 
			     	                if(item.no==item1.no){
			     						let leng=(this.nav_type_data[eid].ordervalue.length)-1;
			     						console.log(this.nav_type_data[eid].ordervalue[this.nav_type_data[eid].ordervalue.length-1].list);
			     	                  this.nav_type_data[eid].ordervalue[leng].list.push(item1);
			     	                  this.nav_type_data[eid].ordervalue[leng].money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
			     	                  this.nav_type_data[eid].ordervalue[leng].youcouponmoney=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
			     	                  this.nav_type_data[eid].ordervalue[leng].score=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].score*100)+(parseInt(item1.score*100)))/100);
			     	                  this.nav_type_data[eid].ordervalue[leng].cash=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].cash*100)+(parseInt(item1.cash*100)))/100);
			     	                  this.nav_type_data[eid].ordervalue[leng].ems_fee=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
			     	                  
									  
			     	                  this.nav_type_data[eid].ordervalue[leng].real_money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
			     	                  							    
			     	             } 
			     	                 })
			     	             }
			     	          
			     	
			     	              
			     	             
			     	        
			     	      });
						  if(res.data.length==0 || datanumber<this.number){
						  	this.order_value_start='noMore'
						  }else{
						  	this.order_value_start='more'
						  }
			     	                }
			     	                });
									}.bind(this),500);
			     }
			     
			},
			order_value_fun:function(eid){
			    this.nav_type_data.forEach((item,id)=>{
					item.ordervalue=[];
					this.order_value_one=[];
				});
				this.order_value_one_start='loading';
				this.order_value_start='loading';
				setTimeout(function(){
				if(eid==0){
					if(this.soustart==true){//搜索
					uni.request({
								 		url: uni.getStorageSync('APP_key') + '/order_data.php',
								 		method: 'POST',
								 		data: {
								 			user:user,
								 			user_key:user_key, 
								 			yhpz:yhpz,
								 			ye:this.ye,
								 			number:this.number,
								 			data_type:'sou',
								 			type:this.nav_typeid,
											sou_value:this.sou_value
					 			
					 		},
					 		header: {
					 			'content-type': 'application/x-www-form-urlencoded'
					 		},
					 		dataType: 'json',
					 	success:(res)=> {
							this.ye+=1;
							var datanumber=0;
							res.data.forEach((item,index)=>{
							       // 判断第一次遍历为空
							       let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'}; 
							       let id=0;
							       for(let i=0;i<this.order_value_one.length;i++){
							          if(this.order_value_one[i].no==item.no){
							             id=1;
							          }
							       }
							       if(id!=1){
									   datanumber=datanumber+1;
							       this.order_value_one.push(obj);
							          res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
							           
							          if(item.no==item1.no){
							            this.order_value_one[this.order_value_one.length-1].list.push(item1);
							            this.order_value_one[this.order_value_one.length-1].money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
							            this.order_value_one[this.order_value_one.length-1].youcouponmoney=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
							            this.order_value_one[this.order_value_one.length-1].score=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].score*100)+(parseInt(item1.score*100)))/100);
							            this.order_value_one[this.order_value_one.length-1].cash=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].cash*100)+(parseInt(item1.cash*100)))/100);
							            this.order_value_one[this.order_value_one.length-1].ems_fee=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
										
										this.order_value_one[this.order_value_one.length-1].real_money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
							          
							       }
							           })
							       }
							    
							});
							if(res.data.length==0 || datanumber<this.number){
								this.order_value_one_start='noMore'
							}else{
								this.order_value_one_start='more'
							}
						  },
						  });
					}else{
					uni.request({
								 		url: uni.getStorageSync('APP_key') + '/order_data.php',
								 		method: 'POST',
								 		data: {
								 			user:user,
								 			user_key:user_key, 
								 			yhpz:yhpz,
								 			ye:this.ye,
								 			number:this.number,
								 			data_type:'all',
								 			type:this.nav_typeid,
					 			
					 		},
					 		header: {
					 			'content-type': 'application/x-www-form-urlencoded'
					 		},
					 		dataType: 'json',
					 	success:(res)=> {
							this.ye+=1;
							var datanumber=0;
							res.data.forEach((item,index)=>{
							       // 判断第一次遍历为空
							       let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'}; 
							       let id=0;
							       for(let i=0;i<this.order_value_one.length;i++){
							          if(this.order_value_one[i].no==item.no){
							             id=1;
							          }
							       }
							       if(id!=1){
									   datanumber=datanumber+1;
							       this.order_value_one.push(obj);
							          res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
							           
							          if(item.no==item1.no){
							            this.order_value_one[this.order_value_one.length-1].list.push(item1);
							            this.order_value_one[this.order_value_one.length-1].money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
										this.order_value_one[this.order_value_one.length-1].youcouponmoney=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
							            this.order_value_one[this.order_value_one.length-1].score=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].score*100)+(parseInt(item1.score*100)))/100);
										this.order_value_one[this.order_value_one.length-1].cash=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].cash*100)+(parseInt(item1.cash*100)))/100);
										this.order_value_one[this.order_value_one.length-1].ems_fee=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].ems_fee*100)+ (parseInt((item1.ems_fee)*100)))/100);
										
										this.order_value_one[this.order_value_one.length-1].real_money=parseFloat((parseInt(this.order_value_one[this.order_value_one.length-1].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
							          
							       }
							           })
							       }
							    
							});
							if(res.data.length==0 || datanumber<this.number){
								this.order_value_one_start='noMore'
							}else{
								this.order_value_one_start='more'
							}
						  },
						  });
						  }
				}else if(eid==5){
					
					uni.request({
								 		url: uni.getStorageSync('APP_key') + '/order_data.php',
								 		method: 'POST',
								 		data: {
								 			user:user,
								 			user_key:user_key, 
								 			yhpz:yhpz,
											ye:this.ye,
											number:this.number,
											data_type:'no',
											type:8,
					 			
					 		},
					 		header: {
					 			'content-type': 'application/x-www-form-urlencoded'
					 		},
					 		dataType: 'json',
					 	success:(res)=> {
					                this.order= res.data; 
									var datanumber=0;
									var day=0;
									var hour=0;
									var minute=0;
									var second=0;
					         res.data.forEach((item,index)=>{
					             // 判断第一次遍历为空
								 day=parseInt(((item.time/1000)/(60*60*24)));
								 hour=parseInt(((item.time/1000)%(60*60*24))/(60*60));
								 minute=parseInt((((item.time/1000)%(60*60*24))%(60*60))/60);
								 second=parseInt((((item.time/1000)%(60*60*24))%(60*60))%60);
								 
					             let obj={ems_fee:0,day:day,hour:hour,minute:minute,second:second,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'};
					              let id=0;console.log(second);
					             for(let i=0;i<this.nav_type_data[eid].ordervalue.length;i++){
					                if(this.nav_type_data[eid].ordervalue[i].no==item.no){
					                   id=1;
					                }
					             }
					             if(id!=1){
									  datanumber=datanumber+1;
					              this.nav_type_data[eid].ordervalue.push(obj);
					                res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
					                 
					                if(item.no==item1.no){
					                  let leng=(this.nav_type_data[eid].ordervalue.length)-1;
									  this.nav_type_data[eid].ordervalue[leng].list.push(item1);
					                  this.nav_type_data[eid].ordervalue[leng].money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
					                  this.nav_type_data[eid].ordervalue[leng].youcouponmoney=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].score=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].score*100)+(parseInt(item1.score*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].cash=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].cash*100)+(parseInt(item1.cash*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].ems_fee=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
					                  
									  
					                  this.nav_type_data[eid].ordervalue[leng].real_money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
					                  		
					             }
					                 })
					             }
					          
					
					              
					             
					        
					      }); 
						  if(res.data.length==0 || datanumber<this.number){
						  	this.order_value_start='noMore'
						  }else{
						  	this.order_value_start='more'
						  }
					                }
					                });
				}else{
					uni.request({
								 		url: uni.getStorageSync('APP_key') + '/order_data.php',
								 		method: 'POST',
								 		data: {
								 			user:user,
								 			user_key:user_key, 
								 			yhpz:yhpz,
											ye:this.ye,
											number:this.number,
											data_type:'no',
											type:this.nav_typeid,
					 			
					 		},
					 		header: {
					 			'content-type': 'application/x-www-form-urlencoded'
					 		},
					 		dataType: 'json',
					 	success:(res)=> {
							this.ye+=1;
					                this.order= res.data; 
							var datanumber=0;
					         res.data.forEach((item,index)=>{
					             // 判断第一次遍历为空
					             let obj={ems_fee:0,name:item.storename,logo:(item.storelogo==''?'../../static/logo.png':item.storelogo),score:0,cash:0,youcouponmoney:0,remark:item.remark,time:item.time,refund_state:item.refund_state,no:item.no,list:[],money:0,real_money:0,state:item.order_state,state_color:item.order_state==9?'green':item.order_state==1?'red':item.order_state==2?'blue':item.order_state==3?'green':item.order_state==4?'red':item.order_state==8?'red':item.order_state>=5?'orange':item.order_state==2?'red':'gray',state_name:item.order_state==9?'退货成功':item.order_state==1?'待付款':item.order_state==2?'出库中':item.order_state==3?'运输中':item.order_state==4?'待评价':item.order_state==8?'退款中':item.order_state==11?'订单已关闭':'交易成功'};
					             let id=0;
					             for(let i=0;i<this.nav_type_data[eid].ordervalue.length;i++){
					                if(this.nav_type_data[eid].ordervalue[i].no==item.no){
					                   id=1;
					                }
					             }
					             if(id!=1){
									 datanumber=datanumber+1;
					             this.nav_type_data[eid].ordervalue.push(obj);
					                res.data.some((item1,index1)=>{   //同理foreach,可以使用return true;打断some循环
					                 
					                if(item.no==item1.no){
										let leng=(this.nav_type_data[eid].ordervalue.length)-1;
					                  this.nav_type_data[eid].ordervalue[leng].list.push(item1);
					                  this.nav_type_data[eid].ordervalue[leng].money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].money*100)+parseInt(item1.p_price*100)*parseInt(item1.count))/100);
					                  this.nav_type_data[eid].ordervalue[leng].youcouponmoney=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].youcouponmoney*100)+(parseInt(item1.coupon_money*100)+parseInt(item1.ucoupon_money*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].score=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].score*100)+(parseInt(item1.score*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].cash=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].cash*100)+(parseInt(item1.cash*100)))/100);
					                  this.nav_type_data[eid].ordervalue[leng].ems_fee=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].ems_fee*100)+ (parseInt(item1.ems_fee*100)))/100);
					                  
									  
					                  this.nav_type_data[eid].ordervalue[leng].real_money=parseFloat((parseInt(this.nav_type_data[eid].ordervalue[leng].real_money*100)+((parseInt(item1.p_price*100)*parseInt(item1.count)+(parseFloat(item1.ems_fee)*100))-(parseInt(item1.score*100)+parseInt(item1.coupon_money*100)+parseInt(item1.cash*100)+parseInt(item1.ucoupon_money*100))))/100); 
					                  							    
					             } 
					                 })
					             }
					          
					
					              
					             
					        
					      });
						  if(res.data.length==0 || datanumber<this.number){
						  	this.order_value_start='noMore'
						  }else{
						  	this.order_value_start='more'
						  }
					                }
					                });
				}
				}.bind(this),500);
			},
			onvalscroll_type_fun: function(typeid) { //选择类型
				this.nav_typeid = typeid;
			},
			swiperchange:function(e){//类型切换
				this.nav_typeid = e.detail.current;
				this.ye=0;
				this.order_value_fun(this.nav_typeid);
			}
		}
	}
</script>

<style lang="scss">
	page{
		overflow: hidden;
	}
	.body{
		position: fixed;
		width: 100%;
		height: 100vh;
		z-index: 9999;
		left:500000upx;
		top:0upx;
	}
	.kong_order{
		height: 340upx;width:400upx;margin:50% auto;
		.kong_order_top{
		height: 240upx;width: 100%;font-family: iconfont;font-size:200upx;text-align: center;line-height: 240upx;color:$color-black-5;
	
	}
	.kong_order_bottom{
		height: 100upx;width: 100%;font-size:36upx;text-align: center;line-height: 100upx;color:$color-black-5;
		
	}
	}
	
	scroll-view{
		width: 100%;
	}
	.hua{
		width: 100%;
		background-color: $bgcolor-all;
		.swiper{
		width: 100%;
		}
	}
.nav {
			width: 100%;
			height: 100upx;

			.nav_scroll {
				width: 100%;
				height: 100upx;
				display: flex;
				flex-wrap: nowrap;
				white-space: nowrap;

				.nav_type_list {
					width: 100%;
					height: 100upx;
					position: relative;

					.nav_list {
						padding: 0upx 40upx;
						display: inline-block;
						line-height: 100upx;
						text-align: center;
						font-size: $color-size-4;
						background-color: $bgcolor-white-0;
					}

					.nav_scroll_type_dong {
						position: absolute;
						bottom: 8upx;
						height: 10upx;
						border-radius: 1000upx;
						background: #fff;
						transition: left 0.5s;
						-webkit-transition: left 0.5s;
						/* Safari */
						-moz-transition: left 0.5s;

					}
				}
			}
		}
.sou_order{
	background:$bgcolor-white-0;
  width:90%;
  padding:20upx 5%;
  height: 60upx;
   box-shadow: 2upx 2upx 10upx #f2f2f2;
    -moz-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
    -o-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
    -webkit-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
       /* For IE 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#f2f2f2')";
    /* For IE 5.5 - 7 */
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#f2f2f2');
			.sou_order_left{
		width:68%;
		height:60upx;
		line-height: 60upx;
		border-radius:100upx;
		border:1px solid $color-all;
		overflow: hidden;
		padding:0px 20% 0px 10%;
		position:relative;
		.sou_order_left_sou{
		font-family: iconfont;
		font-size: $color-size-4;
		color:$color-all;
		position:absolute;
		left:6upx;
		width:60upx;
		height: 60upx;
		text-align: center;
		}
		.sou_order_center{
			width:100%;
			height: 100%;
			.sou_order_center_input{
		width:100%;
		height: 100%;	
		}
		}
		.sou_order_right{
		width: 20%;
		height: 60upx;
		line-height: 60upx;
		text-align:center;
		background:$color-all;
		position:absolute;
		right:0px;
		top:0px;
		font-size: $color-size-5;
		color:#fff;
		}
		
		}
		
}


.order_box{
  width: 94%;
  background:$bgcolor-white-0;
  border-radius: 30upx;
  margin: 20upx auto;
  box-shadow: 2upx 2upx 10upx #f2f2f2;
    -moz-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
    -o-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
    -webkit-box-shadow: 2upx 2upx 10upx #f2f2f2; /* 老的 Firefox */
       /* For IE 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#f2f2f2')";
    /* For IE 5.5 - 7 */
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#f2f2f2');
	.order_box_top{
	  width: 100%;
	  height: 80upx;
	  font-size: 14px;
	  display:block;
	  color:#000;
	  .order_box_top_shopname{
	  width: 67%;
	  height: 80upx;
	  padding-left:3%;
	  line-height: 80upx;
	  float: left;
	  display: flex;
	  justify-content: flex-start;
	  .order_box_top_shopname_img{
		  width: 40upx;
		  height: 40upx;
		  padding-top: 10upx;
	  }
	  .order_box_top_shopname_name{
	  		max-width: 80%;
			height: 80upx;
			padding-left: 10upx;
			line-height: 80upx;
			font-size:$color-size-4;
			color:$color-black-0;
	  }
	  .order_box_top_shopname_icon{
	  		   width: 80upx;
	  		    height: 80upx;
	  			line-height: 80upx;
	  			font-size:$color-sizeicon-2;
	  			color:$color-black-4;
				font-family: iconfont;
	  }
	}
	.order_box_top_state{
	  width: 27%;
	  height: 80upx;
	  line-height: 80upx;
	  padding-right:3%;
	  float: left;
	  text-align: right;
	}
	}
	
	
	.order_box_content{
	  width: 94%;
	  padding:20upx 3%;
	    display:block;
	    position: relative;
		.order_box_content_goods{
	  width: 100%;
	  height: 200upx;
	  /* background: yellow; */
	}
	.order_box_content_goods_img{
	  width: 200upx;
	  height: 200upx;
	  padding-bottom: 16upx;
	  /* background: red; */
	  text-align: center;
	  float: left;
	  .order_box_content_goods_img img{
	    height: 200upx;
	    width: 200upx;
	  
	  }
	}
	.order_box_content_goods_info{
	  width: 60%;
	    padding-left: 2%;
	    height: 200upx;
	    float: left;
	    .order_box_content_goods_info_left{
	      width: 100%;
	      height: 200upx;
	      float: left;
	      margin-left: 1%; 
	    }
	    .order_box_content_goods_info_title{
	      width:100%;
	      line-height: 34upx;
	      font-size:$color-size-4;
	      color:$color-black-0;
	    }
	    .order_box_content_goods_info_spec{
	       width:100%;
	       margin-top: 6upx;
	      height: 40upx;
	      font-size: 34upx;
	      font-size:$color-size-3;
	      color:$color-black-3;
	    }
		.order_box_content_goods_info_money{
		   width:100%;
		   margin-top: 6upx;
		  height: 40upx;
		  font-size:$color-size-3;
		  color:$color-red-0;
		  .order_box_content_goods_info_money_span{
		  font-size:$color-size-3;
		  color:$color-black-2;
		}
		}
		
	.order_box_content_goods_info_price{
	  font-size:$color-size-4;
	}
	.order_box_content_goods_info_num{
	  font-size:$color-size-4;
	}
	}
	
	
	
	
	
	
	
	}
	
	
	.order_box_bottom{
	  width: 90%;
	  margin: 0 5%;
	  .order_box_bottom_top{
	  width: 100%;
	  height:60upx;
	  line-height: 60upx;
	  font-size:$color-size-1;
	  color:$color-black-2;
	  text-align: right;
	  .order_box_bottom_top_span{
	  
	    font-size:$color-size-7;
	    color:$color-red-0;
	}
	}
	
	.order_box_bottom_bottom{
	  width: 100%;
	  text-align: right;
	  font-size: $color-size-4;
	  height: 90upx;
	  display: flex;
	  justify-content: flex-start;
	  flex-direction: row-reverse;
	  .order_box_bottom_bottom_pay{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    font-size:$color-size-5;
	    color:$color-all;
	    box-sizing: border-box;
	    border: 1upx solid $color-all;
	  }
	  .order_box_bottom_bottom_other{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-black-3;
	    border: 1px solid $color-black-3;
	  }
	  .order_box_bottom_bottom_del{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-black-6;
	    border: 1upx solid $color-black-6;
	  }
	  .order_box_bottom_bottom_ems{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-orange-0;
	    border: 1px solid $color-orange-0;
	  }
	  .order_box_bottom_bottom_eva{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    background: #fff;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-all;
	    border: 1px solid $color-all;
	  }
	  .order_box_bottom_bottom_yes{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-all;
	    border: 1px solid $color-all;
	  }
	  .order_box_bottom_bottom_tix{
	    height: 60upx;
	    line-height: 60upx;
	    padding:0 20upx;
	    border-radius: 60upx;
	    text-align: center;
	    margin: 10upx 0 20upx 20upx;
	    box-sizing: border-box;
	    color:$color-green-2;
	    border: 1upx solid $color-green-2;
	  }
	}
	}
}


view, text {
	     box-sizing: content-box;
	}
</style>
